<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('Amount/index')}">额度管理</a></li>
			<li><a href="{:U('Amount/info')}">添加额度</a></li>
			<li class="active"><a>代付</a></li>
		</ul>
		<form class="well form-search" method="post" action="">
			金额: 
			<input type="number" name="amount"  value="{:I('request.amount')}" placeholder="请输入金额">
			<input type="submit" class="btn btn-primary" value="提交" />
		</form>
		<form method="post" class="js-ajax-form">
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>提交时间</th>
						<th>银行卡</th>
						<th>账户名</th>
						<th>金额</th>
						<th>提交状态</th>
						<th>交易状态</th>
						<th align="center">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<php>$statuses=array("0"=>'交易未发送',"1"=>'交易已发送且成功(扣款成功)',"2"=>'交易已发送且失败(扣款失败)',"3"=>'交易发送中');</php>
					<foreach name="list" item="vo">
					<tr>
						<td align="center">{$vo.crtime}</td>
						<td>{$vo.accntno}</td>
						<td>{$vo.accntnm}</td>
						<td>{$vo.amount}</td>
						<td>{$vo['ret']=='000000'?'成功':$vo['ret']}</td>
						<php>$sta=empty($statuses[$vo['state']])?'未查询':$statuses[$vo['state']]</php>
						<td>{$sta}</td>
						<td align="center">
						<if condition="($vo['state'] neq '1' && $vo['ret'] eq '000000')">
							<!-- <a href="{:U('Amount/check_order',array('id'=>$vo['id']))}">查询交易状态</a> -->
						</if>
						</td>
					</tr>
					</foreach>
				</tbody>
				<tfoot>
				<tr>
					<td>当页合计：</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
				</tfoot>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
        $(function () {
            var arr = [3];//要取哪几列的合计
            var def = 'var ';
            for(var a in arr){
                def += ('total'+arr[a]+'=0,');
            }
            def=def.substring(0,def.length-1)+';';
            eval(def);//执行定义
            $('tbody tr').each(function() {
                for(var i in arr){
                    $(this).find('td:eq('+arr[i]+')').each(function(){
                        var tmp = $(this).text();
                        if(tmp === ''){
                            tmp = 0;
                        }
                        eval('total'+arr[i]+'+=parseFloat(tmp);');
                    });
                }
            });
            for(var x in arr){
                $('tfoot tr:eq(0)').find('td:eq('+arr[x]+')').text(eval('total'+arr[x]));
            }
        });
	</script>
</body>
</html>